Core::IOptionsPage Class

class Core::IOptionsPage

The IOptionsPage class is an interface for providing pages for the Options dialog (called Preferences on macOS). More...

Header: #include <coreplugin/dialogs/ioptionspage.h>

Public Functions

IOptionsPage(bool registerGlobally = true)
int category() const
Utils::FilePath categoryIconPath() const
void deleteWidget()
QString displayCategory() const
QString displayName() const
int id() const

Static Public Members

const QList<Core::IOptionsPage *> allOptionsPages()

Protected Functions

void setAutoApply()
void setDisplayName(const QString &displayName)
void setFixedKeywords(const QStringList &keywords)
void setId(int id)

Detailed Description

Member Function Documentation

[explicit] IOptionsPage::IOptionsPage(bool registerGlobally = true)

Constructs an options page and registers it at the global options page pool if registerGlobally is true.

[static] const QList<Core::IOptionsPage *> IOptionsPage::allOptionsPages()

Returns a list of all options pages.

int IOptionsPage::category() const

Returns the unique id for the category that the options page should be displayed in. This id is used for sorting the list on the left side of the Options dialog.

Utils::FilePath IOptionsPage::categoryIconPath() const

Returns the path to the category icon of the options page. This icon will be read from this path and displayed in the list on the left side of the Options dialog.

void IOptionsPage::deleteWidget()

Deletes the cached page widget, if there is one, so that the next createWidget() builds a fresh one.

The Options search builds pages that are never shown, to read their labels; those have no tab to take them down again. They must not be left to the static IOptionsPage's own destructor, which runs after QApplication is gone.

QString IOptionsPage::displayCategory() const

Returns the translated category name of the options page. This name is displayed in the list on the left side of the Options dialog.

QString IOptionsPage::displayName() const

Returns the translated display name of the options page.

See also setDisplayName().

int IOptionsPage::id() const

Returns a unique identifier for referencing the options page.

See also setId().

[protected] void IOptionsPage::setAutoApply()

Marks the page as applying its changes right away.

Such a page is never dirty, so the Options dialog neither enables Apply for it nor asks about unapplied changes when leaving it. This is the widget counterpart of an auto-apply Utils::AspectContainer.

[protected] void IOptionsPage::setDisplayName(const QString &displayName)

Sets displayName as the display name of the options page.

See also displayName().

[protected] void IOptionsPage::setFixedKeywords(const QStringList &keywords)

Sets keywords as the search keywords of the options page, instead of scraping them off the page widget. Lets a page whose widget is expensive to build stay out of the Options search, which would otherwise build every page just to read its labels.

The list must cover every text the widget would have been scraped for; that is checked, once the page is shown, by checkFixedKeywords(). Terms that do not appear in the widget at all are welcome in addition.

[protected] void IOptionsPage::setId(int id)

Sets the id of the options page.

See also id().